package com.woniu.zsd.order.controller;


import com.woniu.zsd.commons.core.model.Result;
import com.woniu.zsd.order.dto.FindOrderCommentDto;
import com.woniu.zsd.order.dto.FindUserOrderDto;
import com.woniu.zsd.order.from.AddCommentFrom;
import com.woniu.zsd.order.from.ReplyCommentFrom;
import com.woniu.zsd.order.service.ICommentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author author
 * @since 2025-03-27
 */
@RestController
@Api(tags = "订单评论")
@RequestMapping("/comment")
public class CommentController {

    @Resource
    private ICommentService iCommentService;

//    @ApiOperation("查看订单评论")
//    @GetMapping("/findComment")
//    public Result<FindOrderCommentDto> findComment(){
//       FindOrderCommentDto dto = iCommentService.findComment();
//       return Result.getResult(FindOrderCommentDto.class).setData(dto);
//    }

    @ApiOperation("新增评论")
    @PostMapping("/addComment")
    public Result addComment(@RequestBody AddCommentFrom acf){
        iCommentService.addComment(acf);
        return Result.getResult().setMsg("新增评论成功");
    }

    @ApiOperation("回复评论")
    @PostMapping("/replyComment")
    public Result replyComment(@RequestBody ReplyCommentFrom rcf){
        iCommentService.replyComment(rcf);
        return Result.getResult().setMsg("回复成功");
    }
}
